package com.ia.aistream.common.enums;

import com.alibaba.fastjson.JSON;

public enum ResponeCodeMsgEnums {
    /**
     *
     */
    OK(0, "成功"),
    ERROR(999, "未知错误"),
    PARAMS_INVALID(100, "请求参数错误"),
    PARAMS_EMPTY(102, "参数为空"),
    GRPC_ERROR(101, "请求失败"),
    PASSWD_INVALID(120, "格式错误，密码格式仅包含6～16长度的数字、字母、下划线"),
    ROBOT_NOT_SELECT(121, "未选择续费机器人"),
    LICENSE_FAILED(140, "凭证验证失败"),
    LICENSE_NOT_FOUND(141, "未找到有效凭证"),
    LICENSE_INVALID(142, "凭证无效"),
    LICENSE_OVERTIME(143, "凭证已过期"),
    TOKEN_CHECK_FAIL(160, "Token鉴权失败"),
    TOKEN_CHECK_TIMEOUT(161, "Token已过期"),
    TOKEN_CREATE_FAIL(162, "Token生成失败"),
    TOKEN_EMPTY(163, "Token为空"),
    LOGIN_OVERTIME(164, "登录超时"),


    PARAM_EXCEPTION(400, "服务器无法理解您的请求"),
    NO_AUTHORITY(401, "需要登录或者没有权限"),
    SIGN_AUTHORITY(403, "非法的客户端请求"),
    NOT_EXISTS(404, "请求的资源不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法错误"),
    NOT_ACCEPTABLE(406, "不支持的内容类型"),
    SERVER_ERROR(500, "服务器错误"),
    SERVER_BUSY(504, "服务器错误"),


    ;


    private int errcode;
    private String errmsg;

    ResponeCodeMsgEnums(int errcode, String errmsg) {
        this.errcode = errcode;
        this.errmsg = errmsg;
    }

    public int getErrcode() {
        return errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
